#ifndef BSP_CAN_BUS_H__
#define BSP_CAN_BUS_H__

#include <stdint.h>
#include "basetype.h"
typedef struct can_msg
{
    uint16_t cob_id;
    uint8_t data_len;
    uint8_t data[8]; // CAN数据接收缓存
} can_msg_t;

/* 完整CAN数据 */
typedef struct {
    uint32 m_canID; /* CAN ID */
    uint8 m_extend; /* 扩展帧标识 */
    uint8 m_remote; /* 远程帧标识*/
    uint8 m_dataLen;/* 数据长度 */
    uint8 m_data[8];/* 数据buf */
}CanMessage;

uint8_t canTransmit(can_msg_t *p_can_msg, uint8_t number);
typedef void (*pfunc_canRxDataProcess)(can_msg_t* p_can_msg);
extern pfunc_canRxDataProcess cmdCanRxDataProcessCallback, motorCanRxDataProcessCallback;

#endif
